import type { ProColumns } from '@ant-design/pro-table';
import type { ${model.code}Item } from '@/services/${model.module}/types';
import { getDictValues } from '@/services/system/dictValue';

export const ${model.code}Columns: ProColumns<${model.code}Item>[] = [
  <#list properties as property>
  <#if (property.formSearchShow)!false || (property.tableShow)!true>
  {
    title: '${property.fieldLabel}',
    dataIndex: '${property.fieldName}',
    <#if property.fieldDict?has_content>
    valueType: 'select',
    valueEnum: await getDictValues('${property.fieldDict}'),
    </#if>
    <#if property.tableWidth?has_content>
    width: '${property.tableWidth}',
    </#if>
    <#if property.tableAlign != 'left'>
    align: '${property.tableAlign}',
    </#if>
    <#if property.tableEllipsis>
    ellipsis: true,
    </#if>
    <#if property.tableCopyable>
    copyable: true,
    </#if>
    <#if !property.tableShow>
    hideInTable: true,
    </#if>
    <#if !property.formSearchShow>
    hideInSearch: true,
    </#if>
    <#if property.formSearchSort?? && property.formSearchSort !=0>
    order: ${property.formSearchSort},
    </#if>
  },
  </#if>
  </#list>
];
